/*
 * @Descripttion: 
 * @Author: junhuafly
 * @Date: 2020-02-28 12:04:11
 * @LastEditors: junhuafly
 * @Email: junhuafly@163.com
 * @LastEditTime: 2020-04-21 10:51:23
 */
// components/recommend/index.js
Component({
  /**
   * 组件的属性列表
   */
  externalClasses: ['custom-class'],
  properties: {
    data: {
      type: Array,
      value: []
    },
    src: String,
    type:String
  },
  ready(){
    var app =  getApp();
    this.setData({
      width:app.globalData.width,
    })
  },
  /**
   * 组件的初始数据
   */
  data: {
    initImg: '/pages/images/19.jpg'
  },

  /**
   * 组件的方法列表
   */
  methods: {
    toDetail({target:{dataset:{type,id}}}){
      wx.redirectTo({
        url: `/pages/${type==='note'?'note':'goods'}/detail/index?id=${id}`,
      })  
    }
  }
})